<template>
  <div>
    <svg-icon icon-class="fullscreen" style="color:#fff; width: 20px; height: 20px" @click="changeScreenFull" />
  </div>
</template>

<script>
import screenfull from 'screenfull'
export default {
  data() {
    return {
      screenFullflag: true
    }
  },
  created() {

  },
  mounted() {

  },
  methods: {
    changeScreenFull() {
      // if (this.screenFullflag) {
      //   document.documentElement.requestFullscreen()
      // } else {
      //   document.exitFullscreen()
      // }
      // this.screenFullflag = !this.screenFullflag

      if (!screenfull.isEnabled) {
        this.$message.error('当前全屏功能不可用')
        return
      }
      screenfull.toggle()
    }
  }
}
</script>

<style scoped lang="less">

</style>
